<div class="container" style="width: 500px;">
    <%  $.each(cpFunctions, function(){  %>
    <%  var action = this; %>
    <% if(action.type == 1){  %>
    <div class="panel panel-success">
        <div class="panel-heading">
            <label>
                <input groupId="<%= action.id %>" for="check_all" type="checkbox" /> 
                <%= action.name %>
            </label>
        </div>
        <div class="panel-body" >
            <% $.each(cpFunctions, function(){  %>
            <% if(this.parent == action.id){  %>
            <div class="row">
                <div class="col-md-4">
                    <input group="<%= action.id %>" for="function" functionId="<%= this.id %>" type="checkbox" /> 
                    <%= this.name %> 
                </div>
                <div class="col-md-8">
                    <span class="help-block pull-right" ><%= this.uri %></span>
                </div>
            </div>
            <% } %>
            <% }); %>
        </div>
    </div>
    <% } %>
    <% }); %>
</div>